﻿<UserControl x:Class="XDCCManager.Controls.FileList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
			 xmlns:Files="clr-namespace:XDCCManager.Model.Files"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
			 DataContext="{DynamicResource ServedFilesContextDataSource}">
	<UserControl.Resources>
		<DataTemplate DataType="{x:Type Files:File}">
			<StackPanel>
				<TextBlock Text="{Binding Name}"/>
				<Grid>
					<Grid.ColumnDefinitions>
						<ColumnDefinition SharedSizeGroup="FileColumnSize" Width="Auto"/>
						<ColumnDefinition SharedSizeGroup="FileColumnPath" Width="Auto"/>
					</Grid.ColumnDefinitions>
					<TextBlock Text="{Binding Size}" Margin="20,0,0,0" TextAlignment="Right"/>
					<TextBlock Text="{Binding Path}" Margin="20,0,0,0" Grid.Column="1"/>
				</Grid>
			</StackPanel>
		</DataTemplate>
	</UserControl.Resources>
	<Grid>
    	<ListBox x:Name="list" ItemsSource="{Binding Files}" HorizontalContentAlignment="Stretch" Grid.IsSharedSizeScope="True"/>
    </Grid>
</UserControl>
